1. Field of the Invention
This invention relates to a coding device for coding a differential value between a sample value and its predicted value, and a decoding device for decoding a code made by coding the differential value.
2. Description of the Related Art
In transmitting image information, voice information and the like by digitizing the information, coding for reducing the amount of information to be transmitted is performed in order to economize transmission cost. Furthermore, decoding is performed in order to return the information sent by being coded to its original state.
As one of many coding methods, differential pulse code modulation (termed hereinafter DPCM) compresses the amount of information by utilizing a correlation between adjacent sample values. That is, there is adopted a method in which a coded sample value is first decoded, a predictive value for the next sample value is obtained using the decoded value (local decoded value), and the difference between the predicted value and the input sample value is quantized and coded.
FIG. 1 is a block diagram showing the configuration of a conventional coding device for performing the most simple preceding-value predictive coding.
In FIG. 1, a sample value X.sub.i as an object of coding is input to an input terminal 10. A subtracter 12 obtains a difference between the sample value X.sub.i and a predictive value P.sub.i. A quantizer 14 quantizes the differential value from the subtracter 12. An output terminal 16 outputs a DPCM code Y.sub.i from the quantizer 14. A dequantizer 18 receives the output from the quantizer 14 as an input and decodes the DPCM code Y.sub.i into the differential value. An adder 20 performs addition of an output from a D-type flip-flop 24 and an output from the dequantizer 18. A limiter 22 limits the amplitude of a local decoded value X.sub.i output from the adder 20 within a dynamic range of the input sample value. The D-type flip-flop 24 supplies the substracter 12 with the local decoded value X.sub.i output from the limiter 22 to the subtracter 12 as the predictive value P.sub.i+1 of the next sample value X.sub.i+1.
Next, the operation of the configuration in FIG. 1 will be explained.
The sample value X.sub.i input to the input terminal 10 is supplied to the subtracter 12. The predicted value P.sub.i is subtracted by the subtracter 12. The differential value output from the subtracter 12 is quantized by the quantizer 14, and is output to the output terminal 16 as the DPCM code Y.sub.i. The DPCM code Y.sub.i output from the quantizer 14 is also input to the dequantizer 18, where the DPCM code Y.sub.i is decoded in a quantized representative value of the differential value, and is then output to the adder 20.
In the adder 20, the preceding-value predictive value P.sub.i output from the D-type flip-flop 24 is added to the quantized representative value from the dequantizer 18. The differential value (quantized representative value) is thereby restored to the sample value (local decoded value). The restored sample value (local decoded value) is limited within a predetermined range relative to its amplitude, and is then supplied to the D-type flip-flop 24. The D-type flip-flop 24 outputs the local decoded value output from the limiter 22 in synchronization with a clock signal, and supplies it for the subtracter 12 and the adder 20 as the predictive value P.sub.i+1 for the next sample value.
In general, the distribution of differential values of predictive values is biased at portions having small values, and it becomes therefore possible to reduce the amount of information by transmitting differential values with encoding by nonlinear quantization.
In conventional coding and decoding devices as described above, a range of values which the input sample value may have, that is, the dynamic range (termed hereinafter D range) is 0-(n-1). If its width is assumed to consists of n levels, the D range of the differential value becomes (-n+1)-(n-1). Its width therefore consists of (2n-1) levels, which is about twice the width of the D range of the input sample value. (In the present specification, for the convenience of explanation, discriminative terminology is used in which the range of allowable values is termed D range, and the width of allowable values is termed D-range width.) As a result, when the quantization characteristic is made a nonlinear characteristic, the maximum value of quantization error (the difference between the differential value before quantization and the differential value after quantization) at portions separated from the predicted value becomes a very large value. This is a big factor for deterioration in picture quality at edge portions (edge business) having large differential values.
On the other hand, if the quantization characteristic is made close to a linear characteristic in order to reduce the above-described deterioration, quantization errors at portions near the predicted value increase. This causes roughness in an reproduced image (increase of granular noise) at flat portions. That is, at a portion where the level gradually changes, like a man's face, a contour (pseudocontour) just like contour lines in a map is produced. Hence, picture quality is deteriorated.